﻿using System;
using System.Web;
using System.Web.UI;

namespace AssetManage.Account
{
    public partial class Login : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Web.Support.Browser.IsSupport(Request.Browser))
            {
                Response.Redirect("~/Error/Browser", false);
                return;
            }
            RegisterHyperLink.NavigateUrl = "Register";
            var returnUrl = HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
            if (String.IsNullOrEmpty(returnUrl))
            {
                returnUrl = "/";
            }
            if (Page.IsPostBack) return;
            if (Page.User.Identity.IsAuthenticated)
            {
                Response.Redirect(returnUrl);
                return;
            }
            Master.OnClickLink("login");
        }
    }
}